import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"
const RouterSheets: RouteRecordRaw[] = [
    {
        path: "/",
        name: "LayOut",
        redirect: "/home",
        component: () => import("../components/LayOut.vue"),
        children: [
            {
                path: "home",
                name: "Home",
                meta: {
                    title: "首页",
                },
                component: () => import("../components/Home/index.vue")
            },
            {
                path: "message",
                name: "Message",
                meta: {
                    title: "消息",
                },
                component: () => import("../components/Message/index.vue")
            },
            {
                path: "frequeently",
                name: "FreQueently",
                meta: {
                    title: "常用",
                },
                component: () => import("../components/FreQueently/index.vue")
            }
        ]
    }, {
        path: "/detail",
        name: "Detail",
        meta: {
            title: "详情",
        },
        component: () => import("../components/Home/index.vue")
    }
]
const router = createRouter({
    routes: RouterSheets,
    history: createWebHashHistory()
})
router.afterEach((to: any, from: any) => {
    console.log(to, from)
    document.title = to.meta.title
})
export default router